package com.honey.mybatis.generator.dao.field;

import com.honey.compilation.java.Clazz;
import com.honey.compilation.java.Decoration;
import com.honey.compilation.java.JavaVisibility;
import com.honey.core.dbmapping.introspect.IntrospectSchema;
import com.honey.core.dbmapping.introspect.IntrospectSchemaColumn;
import com.honey.mybatis.generator.AbstractField;
import com.honey.mybatis.generator.MybatisPlugin;
import com.honey.mybatis.generator.dao.DaoConstant;

public class NameSpaceField extends AbstractField {
	
	public NameSpaceField(Clazz clazz, MybatisPlugin belongPlugin,
			IntrospectSchema introspectSchema,
			IntrospectSchemaColumn introspectSchemaColumn) {
		super(clazz, belongPlugin, introspectSchema, introspectSchemaColumn);
	}

	@Override
	protected String getFieldName() {
		return DaoConstant.MAPPER_NAME_SPACE_FIELD_NAME;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getDecoration()
	 */
	@Override
	protected Decoration getDecoration() {
		Decoration answer = super.getDecoration();
		answer.setVisibility(JavaVisibility.PROTECTED);
		answer.setFinal(true);
		answer.setStatic(true);
		return answer;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getInitialization()
	 */
	@Override
	protected String getInitialization() {
		return mybatisPlugin.getDaoInterfacePackage()+"." + super.getInterfaceClassName(introspectSchema.getSchema())+"." ;
	}
	
}
